<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>接单记录 - 从业者中心</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
        }
        
        body {
            background-color: #f8f9fa;
            color: #333;
        }
        
        /* 头部样式 */
        .header {
            background: linear-gradient(135deg, #1890ff, #096dd9);
            color: white;
            padding: 12px 15px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
        }
        
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .location {
            display: flex;
            align-items: center;
            font-size: 14px;
        }
        
        .location i {
            margin-right: 5px;
        }
        
        .user-info {
            display: flex;
            align-items: center;
        }
        
        .avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: #fff;
            color: #1890ff;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 8px;
            font-weight: bold;
            font-size: 14px;
        }
        
        /* 统计概览 */
        .stats-overview {
            background: white;
            padding: 15px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }
        
        .stats-container {
            display: flex;
            justify-content: space-around;
            text-align: center;
        }
        
        .stat-item {
            padding: 10px;
        }
        
        .stat-value {
            font-size: 20px;
            font-weight: bold;
            color: #1890ff;
        }
        
        .stat-label {
            font-size: 12px;
            color: #666;
            margin-top: 5px;
        }
        
        /* 状态筛选 */
        .status-filter {
            padding: 15px;
            background: white;
            border-top: 1px solid #eee;
            border-bottom: 1px solid #eee;
        }
        
        .status-title {
            font-size: 14px;
            margin-bottom: 10px;
            color: #666;
        }
        
        .status-buttons {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        
        .status-buttons::-webkit-scrollbar {
            display: none;
        }
        
        .status-btn {
            flex-shrink: 0;
            padding: 8px 15px;
            background: #f5f5f5;
            border-radius: 20px;
            text-align: center;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
        }
        
        .status-btn.active {
            background: #1890ff;
            color: white;
        }
        
        /* 订单记录列表 */
        .order-records {
            padding: 15px;
            min-height: calc(100vh - 250px);
        }
        
        .record-card {
            background: white;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            position: relative;
            border-left: 4px solid #1890ff;
        }
        
        .record-card.status-1 { border-left-color: #52c41a; } /* 已完成 */
        .record-card.status-2 { border-left-color: #ffc53d; } /* 进行中 */
        .record-card.status-3 { border-left-color: #ff4d4f; } /* 已取消 */
        .record-card.status-4 { border-left-color: #8c8c8c; } /* 待确认 */
        
        .record-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            align-items: center;
        }
        
        .record-title {
            font-size: 16px;
            font-weight: 600;
            flex: 1;
        }
        
        .record-status {
            font-size: 12px;
            padding: 3px 8px;
            border-radius: 10px;
        }
        
        .status-completed {
            background: #f6ffed;
            color: #52c41a;
        }
        
        .status-ongoing {
            background: #fffbe6;
            color: #faad14;
        }
        
        .status-cancelled {
            background: #fff2f0;
            color: #ff4d4f;
        }
        
        .record-time {
            font-size: 13px;
            color: #666;
            margin-bottom: 10px;
        }
        
        .record-details {
            display: flex;
            margin-bottom: 10px;
        }
        
        .detail-item {
            flex: 1;
            padding: 5px;
            font-size: 13px;
            background: #f9f9f9;
            border-radius: 5px;
            margin-right: 10px;
            display: flex;
            flex-direction: column;
        }
        
        .detail-label {
            color: #999;
            font-size: 12px;
        }
        
        .detail-value {
            font-weight: 500;
        }
        
        .record-actions {
            display: flex;
            justify-content: space-between;
            margin-top: 10px;
        }
        
        .action-btn {
            padding: 6px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: white;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.3s ease;
        }
        
        .action-btn.primary {
            background: #1890ff;
            color: white;
            border-color: #1890ff;
        }
        
        .action-btn:hover {
            background: #f5f5f5;
        }
        
        .action-btn.primary:hover {
            background: #096dd9;
        }
        
        /* TabBar 底部导航 */
        .tabbar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background: #fff;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        
        .tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex: 1;
            height: 100%;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }
        
        .tab-icon {
            font-size: 20px;
            margin-bottom: 4px;
            color: #666;
        }
        
        .tab-label {
            font-size: 11px;
            color: #666;
        }
        
        /* 从业者特殊样式 */
        .worker-tab .tab-item:nth-child(3) {
            background: #f6ffed;
        }
        
        .worker-tab .tab-item:nth-child(3) .tab-icon {
            color: #52c41a;
        }
        
        .worker-tab .tab-item:nth-child(3) .tab-label {
            color: #52c41a;
        }
        
        /* 隐藏其他角色的TabBar */
        .hidden {
            display: none;
        }
        
        .page-title {
            padding: 10px 15px;
            font-size: 18px;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <!-- 头部区域 -->
    <div class="header">
        <div class="top-bar">
            <div class="user-info">
                <div class="avatar">李</div>
                <div class="user-name">李师傅</div>
            </div>
            <div class="id-display">
                <span>平台ID: </span><span id="user-id">WF789012</span>
            </div>
        </div>
        <div class="page-title">我的接单记录</div>
    </div>
    
    <!-- 统计概览 -->
    <div class="stats-overview">
        <div class="stats-container">
            <div class="stat-item">
                <div class="stat-value">¥1,685</div>
                <div class="stat-label">本月收入</div>
            </div>
            <div class="stat-item">
                <div class="stat-value">36单</div>
                <div class="stat-label">已完成任务</div>
            </div>
            <div class="stat-item">
                <div class="stat-value">4.8分</div>
                <div class="stat-label">平均评分</div>
            </div>
        </div>
    </div>
    
    <!-- 状态筛选 -->
    <div class="status-filter">
        <div class="status-title">订单状态</div>
        <div class="status-buttons">
            <div class="status-btn active">全部</div>
            <div class="status-btn">待确认</div>
            <div class="status-btn">进行中</div>
            <div class="status-btn">待评价</div>
            <div class="status-btn">已完成</div>
            <div class="status-btn">已取消</div>
        </div>
    </div>
    
    <!-- 订单记录列表 -->
    <div class="order-records">
        <!-- 已完成任务 -->
        <div class="record-card status-1">
            <div class="record-header">
                <div class="record-title">物流晚班分拣员</div>
                <div class="record-status status-completed">已完成</div>
            </div>
            
            <div class="record-time">
                <div>2023-10-15 20:00 - 次日01:00 (5小时)</div>
                <div>完成时间：2023-10-16 01:10</div>
            </div>
            
            <div class="record-details">
                <div class="detail-item">
                    <div class="detail-label">任务收入</div>
                    <div class="detail-value">¥180</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">发布方</div>
                    <div class="detail-value">京东物流园</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">地点</div>
                    <div class="detail-value">高新区</div>
                </div>
            </div>
            
            <div class="record-actions">
                <button class="action-btn">查看评价</button>
                <button class="action-btn">再次接单</button>
            </div>
        </div>
        
        <!-- 待评价任务 -->
        <div class="record-card status-1">
            <div class="record-header">
                <div class="record-title">超市理货员</div>
                <div class="record-status status-completed">待评价</div>
            </div>
            
            <div class="record-time">
                <div>2023-10-16 07:00 - 15:00 (8小时)</div>
                <div>完成时间：2023-10-16 15:05</div>
            </div>
            
            <div class="record-details">
                <div class="detail-item">
                    <div class="detail-label">任务收入</div>
                    <div class="detail-value">¥150</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">发布方</div>
                    <div class="detail-value">沃尔玛超市</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">地点</div>
                    <div class="detail-value">西乡塘区</div>
                </div>
            </div>
            
            <div class="record-actions">
                <button class="action-btn primary">去评价</button>
                <button class="action-btn">查看详情</button>
            </div>
        </div>
        
        <!-- 进行中任务 -->
        <div class="record-card status-2">
            <div class="record-header">
                <div class="record-title">餐厅晚班服务员</div>
                <div class="record-status status-ongoing">进行中</div>
            </div>
            
            <div class="record-time">
                <div>2023-10-17 18:00 - 22:00 (4小时)</div>
                <div>剩余时间：1小时20分</div>
            </div>
            
            <div class="record-details">
                <div class="detail-item">
                    <div class="detail-label">任务收入</div>
                    <div class="detail-value">¥200</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">发布方</div>
                    <div class="detail-value">万象城海天餐厅</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">地点</div>
                    <div class="detail-value">青秀区</div>
                </div>
            </div>
            
            <div class="record-actions">
                <button class="action-btn primary">签到打卡</button>
                <button class="action-btn">联系发布方</button>
            </div>
        </div>
        
        <!-- 待确认任务 -->
        <div class="record-card status-4">
            <div class="record-header">
                <div class="record-title">展会搭建协助</div>
                <div class="record-status">待确认</div>
            </div>
            
            <div class="record-time">
                <div>2023-10-18 08:00 - 17:00 (8小时)</div>
                <div>状态：等待雇主确认</div>
            </div>
            
            <div class="record-details">
                <div class="detail-item">
                    <div class="detail-label">任务收入</div>
                    <div class="detail-value">¥300</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">发布方</div>
                    <div class="detail-value">国际会展中心</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">地点</div>
                    <div class="detail-value">青秀区</div>
                </div>
            </div>
            
            <div class="record-actions">
                <button class="action-btn">取消申请</button>
                <button class="action-btn">联系雇主</button>
            </div>
        </div>
        
        <!-- 已取消任务 -->
        <div class="record-card status-3">
            <div class="record-header">
                <div class="record-title">家具搬运协助</div>
                <div class="record-status status-cancelled">已取消</div>
            </div>
            
            <div class="record-time">
                <div>2023-10-10 14:00 - 16:00 (2小时)</div>
                <div>取消时间：2023-10-10 13:20</div>
            </div>
            
            <div class="record-details">
                <div class="detail-item">
                    <div class="detail-label">任务收入</div>
                    <div class="detail-value">¥100</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">发布方</div>
                    <div class="detail-value">个人雇主</div>
                </div>
                <div class="detail-item">
                    <div class="detail-label">地点</div>
                    <div class="detail-value">兴宁区</div>
                </div>
            </div>
            
            <div class="record-actions">
                <button class="action-btn">再次申请</button>
                <button class="action-btn">查看详情</button>
            </div>
        </div>
    </div>
    
    <!-- 从业者 TabBar -->
    <nav class="tabbar worker-tab">
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-list"></i></div>
            <div class="tab-label">任务大厅</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-wallet"></i></div>
            <div class="tab-label">钱包</div>
        </div>
        <div class="tab-item active">
            <div class="tab-icon"><i class="fas fa-history"></i></div>
            <div class="tab-label">接单记录</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-star"></i></div>
            <div class="tab-label">信用评级</div>
        </div>
        <div class="tab-item">
            <div class="tab-icon"><i class="fas fa-user"></i></div>
            <div class="tab-label">我的</div>
        </div>
    </nav>
    
    <!-- 其他角色TabBar(隐藏) -->
    <nav class="tabbar user-tab hidden">
        <!-- 普通用户TabBar内容 -->
    </nav>
    
    <nav class="tabbar merchant-tab hidden">
        <!-- 商家TabBar内容 -->
    </nav>
    
    <script>
        // 角色切换函数
        function switchRole(role) {
            document.querySelectorAll('.tabbar').forEach(tab => {
                tab.classList.add('hidden');
            });
            
            const targetTab = document.querySelector(`.${role}-tab`);
            if (targetTab) {
                targetTab.classList.remove('hidden');
            }
        }
        
        // 为Tab项添加点击事件
        document.querySelectorAll('.tab-item').forEach(item => {
            item.addEventListener('click', function() {
                const parentTab = this.closest('.tabbar');
                parentTab.querySelectorAll('.tab-item').forEach(el => {
                    el.classList.remove('active');
                });
                
                this.classList.add('active');
            });
        });
        
        // 状态按钮点击事件
        document.querySelectorAll('.status-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                document.querySelectorAll('.status-btn').forEach(el => {
                    el.classList.remove('active');
                });
                this.classList.add('active');
                
                const statusType = this.textContent;
                document.querySelector('.status-title').textContent = `订单状态: ${statusType}`;
            });
        });
        
        // 操作按钮事件
        document.querySelectorAll('.action-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const taskTitle = this.closest('.record-card').querySelector('.record-title').textContent;
                if (this.classList.contains('primary')) {
                    alert(`正在执行操作: ${this.textContent} - ${taskTitle}`);
                } else {
                    alert(`操作: ${this.textContent} - ${taskTitle}`);
                }
            });
        });
        
        // 初始化显示从业者 TabBar
        switchRole('worker');
    </script>
</body>
</html>
